using System.Collections;
using System.Collections.Generic;
using JSG.BubbleShoot.ScriptableObjects;
using UnityEngine;
using UnityEngine.SceneManagement;

namespace JSG.BubbleShoot.UI
{
    public class LevelsUI : MonoBehaviour
    {
        public Transform BtnParent;
        public GameObject LevelBtnPrefab1;
        [SerializeField]
        private Content m_Contents;
        // Start is called before the first frame update
        void Start()
        {

            for (int i = 0; i < m_Contents.m_Levels.Length; i++)
            {
                GameObject btn = Instantiate(LevelBtnPrefab1);
                btn.transform.parent = BtnParent;
                Btn_Level b = btn.GetComponent<Btn_Level>();
                b.LevelNum = i;
            }
        }

        // Update is called once per frame
        void Update()
        {

        }
        public void BtnStartGame()
        {
            SceneManager.LoadScene("Levels");
        }
        public void BtnBack()
        {
            UISystem.RemoveUI("LevelsUI");
            UISystem.ShowUI("MainMenUI");
        }
    }
}